﻿using System;
using UnityEngine;
namespace LitTools
{
    /// <summary>
    /// 触发器观察
    /// </summary>
    [DisallowMultipleComponent]
    public class TriggerObserver : MonoBehaviour
    {
        public event Action<Collider> OnTriggerEnterAct;
        public event Action<Collider> OnTriggerStayAct;
        public event Action<Collider> OnTriggerExitAct;
        private void OnTriggerEnter(Collider other)
        {
            OnTriggerEnterAct?.Invoke(other);
        }

        private void OnTriggerStay(Collider other)
        {
            OnTriggerStayAct?.Invoke(other);
        }

        private void OnTriggerExit(Collider other)
        {
            OnTriggerExitAct?.Invoke(other);
        }
    }
}